Skip to content

1368 nxdltypes invalid xml schema - #1634

Merged
woutdenolf merged 6 commits into
mainfrom
1368-nxdltypes-invalid-xml-schema2
Sep 1, 2026
Merged

1368 nxdltypes invalid xml schema#1634
woutdenolf merged 6 commits into
mainfrom
1368-nxdltypes-invalid-xml-schema2

Conversation

@woutdenolf

@woutdenolf woutdenolf commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

The current XSD files are not strictly valid: xs:element under xs:documentation cannot contain character data.

We use this to provide machine-readable examples to the NXDL units for doc generation

<xs:simpleType name="NX_ANGLE">
    <xs:annotation>
        <xs:documentation>
            units of angle
            <xs:element name="example">rad</xs:element>
        </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string" />
</xs:simpleType>

But xs:annotation has xs:appinfo for machine-readable content

<xs:simpleType name="NX_ANGLE">
    <xs:annotation>
        <xs:documentation>
            units of angle
        </xs:documentation>
        <xs:appinfo>
            <example>rad</example>
        </xs:appinfo>
    </xs:annotation>
    <xs:restriction base="xs:string" />
</xs:simpleType>

This PR:

  • Use xs:appinfo in nxdlTypes.xsd
  • Add validation of the xsd files themselves to the unit tests

@woutdenolf woutdenolf linked an issue Jun 27, 2026 that may be closed by this pull request
@woutdenolf
woutdenolf requested a review from a team June 27, 2026 08:51
@woutdenolf

woutdenolf commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

The rendered content is identical, except for example vs. example(s).

Edit: fixed -> it should be examples instead of example(s)

image

@woutdenolf woutdenolf self-assigned this Jun 27, 2026
@woutdenolf woutdenolf changed the title 1368 nxdltypes invalid xml schema2 1368 nxdltypes invalid xml schema Jun 27, 2026
Comment thread nxdlTypes.xsd
Comment thread dev_tools/docs/xsd_units.py
Comment thread dev_tools/docs/xsd_units.py Outdated
@woutdenolf
woutdenolf force-pushed the 1368-nxdltypes-invalid-xml-schema2 branch from 194ad51 to 2836e66 Compare July 22, 2026 16:55
@woutdenolf
woutdenolf requested a review from PeterC-DLS August 29, 2026 16:10

@PeterC-DLS PeterC-DLS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@woutdenolf
woutdenolf merged commit 1e7c133 into main Sep 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nxdlTypes: invalid XML schema

3 participants